/**
 * Created by WT on 2017/3/15.
 */
//清空表单

function clearForm(){
    $('#form_Group').form('reset');

}

//提交表单
function saveForm(){
    $('#form_Group').form('submit', {
        url: ROOT_PATH + '/permission/authorityGroup/edit.shtml',
        onSubmit: function () {
            var isValid = $(this).form('validate');
            if (!isValid) {
                $.messager.alert("提示", "请正确填写信息！", "info")
            }
            return isValid;	// 返回false终止表单提交
        },
        success: function (result) {
            result = $.parseJSON(result);
            if (result.success) {
                layer.msg('保存成功', {
                    icon: 1,
                    time: 1000 //2秒关闭（如果不配置，默认是3秒）
                }, function(){
                    var indexp = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(indexp); //再执行关闭
                });
                parent.$('#authorityGroupList').datagrid('load');
            }
            else {
                layer.msg('保存失败', {
                    icon: 2,
                    time: 1000
                });
            }
        }
    });
}
